import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      //重定向
      redirect: '/rotate',
    },
    //自转
    {
      path: '/rotate',
      name: 'rotate',
      component: () => import('@/views/RotateView.vue'),
    },
    //控制台
    {
      path: '/PlotView',
      name: 'PlotView',
      component: () => import('@/views/PlotView.vue'),
    },
    //城市视图
    {
      path: '/cityView',
      name: 'cityView',
      component: () => import('@/views/CityView.vue'),
    },
    //查询
    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/SearchView.vue'),
    },
    //桥梁
    {
      path: '/bridge',
      name: 'bridge',
      component: () => import('@/views/BridgeView.vue'),
    },
    //测量
    {
      path: '/measure/:type', // 动态路由参数
      name: 'measure',
      component: () => import('@/views/MeasureView.vue'),
    },
  ],
})

export default router
